package com.xjm.api.web;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xjm.entity.BannerModel;
import com.xjm.entity.vo.Result;
import com.xjm.service.BannerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user/banner")
@RequiredArgsConstructor
public class WebBannerController {
    private final BannerService bannerService;

    @RequestMapping("/list")
    public Result<List<BannerModel>> getBanner(){
        LambdaQueryWrapper<BannerModel> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BannerModel::getStatus,1);
        return Result.success(bannerService.list(wrapper));
    }
}
